--wuqibo
--2021.11.17
--数学直线方程类
--方程式(y = kx + b)

---@class MathLine
local MathLine = fb_class("MathLine")

function MathLine:ctor(x1, y1, x2, y2)
    self.k = (y2 - y1) / (x2 - x1)
    self.b = y2 - self.k * x2
end

function MathLine:GetY(x)
    return self.k * x + self.b
end

return MathLine
